TabPanel = function() {
	TabPanel.superclass.constructor.call(this, {
		id: 'tabPanel',
		region: 'center',
		deferredRender: false,
		activeTab: 0,
		enableTabScroll: true,
		items: [{
			contentEl: 'dashboard',
			title: 'Dashboard',
			iconCls: 'dashboard-icon',
			
			closable: false,
			autoScroll: true
		}, new Ext.ux.ManagedIframePanel({
			title: "Donate",
			id: 'donate',
			iconCls: 'donate-icon',
			loadMask:true,
			defaultSrc:'http://extbind.com/app/donate/',
			autoScroll:true
		})]
	});
};

Ext.extend(TabPanel, Ext.TabPanel, {
	addTab: function(zone) {
		var exists = this.getItem(zone);
		if(exists){
			this.setActiveTab(exists);
		} else {
			// make new tab
			var tab = new Ext.Panel ({
				id: zone, // keeps this
				title: zone,
				closable:true,
				autoScroll:true,
				iconCls: 'zone-icon'
			});
			
			// show tab
			this.add(tab).show();
			
			// setup record panels
			var panelA = new RecordGridPanel({
				type: 'A',
				zone: zone
			});
			panelA.render(tab.body);
			
			var panelAAAA = new RecordGridPanel({
				type: 'AAAA',
				zone: zone
			});
			panelAAAA.render(tab.body);
			
			var panelCNAME= new RecordGridPanel({
				type: 'CNAME',
				zone: zone
			});
			panelCNAME.render(tab.body);
			
			var panelMX = new RecordGridPanel({
				type: 'MX',
				zone: zone
			});
			panelMX.render(tab.body);
			
			var panelNS = new RecordGridPanel({
				type: 'NS',
				zone: zone
			});
			panelNS.render(tab.body);
			
			var panelTXT = new RecordGridPanel({
				type: 'TXT',
				zone: zone
			});
			panelTXT.render(tab.body);
			
			// FFFFFFFFFFFFFFFFFFFFF SOA here
		}
	}
});